home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / CHIPCD_02_2002.iso / Internet / Macromedia ColdFusion Server 5 / coldfusion-50-win-us.exe / data1.cab / Examples / CFDOCS / snippets / cfform.cfm < prev    next >
Encoding:
Text File  |  2001-06-13  |  2.4 KB  |  86 lines

  1. <!--- This example shows the use of CFINPUT controls in
  2. a CFFORM --->
  3. <HTML>
  4. <HEAD>
  5.  
  6. <TITLE>
  7. CFFORM Example
  8. </TITLE>
  9. </HEAD>
  10.  
  11. <BASEFONT FACE="Arial, Helvetica" SIZE=2>
  12. <BODY  bgcolor="#FFFFD5">
  13.  
  14. <H3>CFFORM Example</H3>
  15.  
  16. <CFIF IsDefined("form.oncethrough") is "Yes">
  17.     <CFIF IsDefined("form.testVal1") is True>
  18.     <H3>Results of Radio Button Test</H3>
  19.     
  20.         <CFIF form.testVal1 is "Yes">Your radio button answer was yes</CFIF>
  21.         <CFIF form.testVal1 is "No">Your radio button answer was no</CFIF>
  22.     </CFIF>
  23.     
  24.     <CFIF IsDefined("form.chkTest2") is True>
  25.     <H3>Results of Checkbox Test</H3>
  26.         Your checkbox answer was yes
  27.     <CFELSE>
  28.         <H3>Results of Checkbox Test</H3>
  29.         Your checkbox answer was no
  30.     </CFIF>
  31.  
  32.     <CFIF IsDefined("form.textSample") is True AND form.textSample is not "">
  33.     <H3>Results of Credit Card Input</H3>
  34.         Your credit card number, <CFOUTPUT>#form.textSample#</CFOUTPUT>, was 
  35.         valid under the MOD 10 algorithm.
  36.     </CFIF>
  37.     
  38.     <CFIF IsDefined("form.sampleSlider") is "True">
  39.     <H3>You gave this page a rating of <CFOUTPUT>#form.sampleSlider#</CFOUTPUT></H3>    
  40.     </CFIF>
  41.     <hr noshade>
  42. </CFIF>
  43. <!--- begin by calling the cfform tag --->
  44. <CFFORM ACTION="cfform.cfm" METHOD="POST" ENABLECAB="Yes">
  45. <TABLE>
  46. <TR>
  47.     <TD>
  48.     <H4>This example displays the radio button input type
  49.     for CFINPUT.</H4>
  50.     Yes <CFINPUT TYPE="Radio" NAME="TestVal1" VALUE="Yes" CHECKED="yes">
  51.     No <CFINPUT TYPE="Radio" NAME="TestVal1" VALUE="No">
  52.     </TD>
  53. </TR>
  54. <TR>
  55.     <TD>
  56.     <H4>This example displays the checkbox input type for CFINPUT.</H4>
  57.     <CFINPUT TYPE="Checkbox" NAME="ChkTest2" VALUE="Yes">
  58.     </TD>
  59. </TR>
  60.  
  61. <TR>
  62.     <TD>
  63.     <H4>This example shows a client-side validation for
  64.     CFINPUT text boxes.</H4>
  65.     <BR>(<I>This item is optional</I>)<BR>
  66.     Please enter a credit card number:
  67.     <CFINPUT TYPE="Text" NAME="TextSample" MESSAGE="Please enter a Credit Card Number" VALIDATE="creditcard" REQUIRED="No">
  68.     </TD>
  69. </TR>
  70.  
  71. <TR>
  72.     <TD>
  73.     <H4>This example shows the use of the CFSLIDER tag.</H4>
  74.     <P>Rate your approval of this example from 1 to 10 by sliding the control.
  75.     <P>1 <CFSLIDER NAME="sampleSlider" LABEL="Sample Slider" RANGE="1,10" MESSAGE="Please enter a value from 1 to 10" SCALE="1" BOLD="No" ITALIC="No" REFRESHLABEL="No"> 10
  76.     </TD>
  77. </TR>
  78. </TABLE>
  79.  
  80. <P><INPUT TYPE="SUBMIT" NAME="SUBMIT" VALUE="show me the result">
  81. <INPUT TYPE="Hidden" NAME="oncethrough" VALUE="yes">
  82. </CFFORM>
  83.  
  84. </BODY>
  85. </HTML>       
  86.